import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:get/get.dart';
import 'package:ty_smart_watch/utils/Log.dart';


///设备扫描控制器
class ScanDeviceController extends GetxController {
  var deviceList = <DiscoveredDevice>[].obs;

  clearDeviceList() {
    deviceList.clear();
    refresh();
  }

  updateDevice(DiscoveredDevice device) {
    bool hasDevice = deviceList.any((d) => d.id == device.id);
    if (!hasDevice) {
      deviceList.add(device);
      refresh();
    }
  }
}
